package com.zzx.condition;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * ImportSelector
 *
 * @author Jesse
 * @version 1.0
 * @date 2021/06/13
 */
// 自定义逻辑，返回需要导入的组件
public class MyImportSelector implements ImportSelector {

    /**
     * 返回值，就是导入容器中的组件全类名
     * AnnotationMetadata：当前标注 @Import 注解的类的所有注解信息
     * @param importingClassMetadata
     * @return
     */
    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        return new String[]{"com.zzx.bean.Blue","com.zzx.bean.Yellow"};
    }
}